package 作业2;
import java.util.Scanner;

public class MinMaxFinder {

  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);

    System.out.print("Enter the first integer: ");
    int num1 = input.nextInt();

    System.out.print("Enter the first integer: ");
    int num2 = input.nextInt();

    System.out.print("Enter the first integer: ");
    int num3 = input.nextInt();

    System.out.print("Enter the first integer: ");
    int num4 = input.nextInt();

    int max, min;

    if (num1 > num2) {
      max = num1;
      min = num2;
    } else {
      max = num2;
      min = num1;
    }

    if (num3 > max) {
      max = num3;
    } else if (num3 < min) {
      min = num3;
    }

    if (num4 > max) {
      max = num4;
    } else if (num4 < min) {
      min = num4;
    }

    System.out.println("最大值是:"+max);
    System.out.println("最小值是:"+min);

  }
}
